import request from '@/router/axios'

export function fetchEimsSaleRefundDetailList(query) {
  return request({
    url: '/eims/salerefunddetail/page',
    method: 'get',
    params: query
  })
}

export function addEimsSaleRefundDetailObj(obj) {
  return request({
    url: '/eims/salerefunddetail',
    method: 'post',
    data: obj
  })
}

export function getEimsSaleRefundDetailObj(id) {
  return request({
    url: '/eims/salerefunddetail/' + id,
    method: 'get'
  })
}

export function delEimsSaleRefundDetailObj(id) {
  return request({
    url: '/eims/salerefunddetail/' + id,
    method: 'delete'
  })
}

export function putEimsSaleRefundDetailObj(obj) {
  return request({
    url: '/eims/salerefunddetail',
    method: 'put',
    data: obj
  })
}

//根据销售单id获取退货详情
export function getSaleRefundDetailListBySaleId(saleId) {
  return request({
    url: '/eims/salerefunddetail/getRefundList/' + saleId,
    method: 'get'
  })
}

//根据销售单单号获取退货详情
export function getSaleRefundDetailListByBillId(billId) {
  return request({
    url: '/eims/salerefunddetail/getRefundListByBillId/' + billId,
    method: 'get'
  })
}
